require 'test/unit'

$: << 'aerosol'
require 'aerosol/base/events/events.rb'

class EventTest < Test::Unit::TestCase

  def test_create_action_listener
    listener = AS::Event::ActionListener.new
    assert_not_nil(listener) #not like this would fail, but it's useful to me.
  end

  def test_action_listener_hears_keys
    @keyFound = false
    listener = AS::Event::ActionListener.new
    listener.action_for_key(:Key_UP){|event| @keyFound = true}
    
    assert(!@keyFound)
    
    #now fake push a different key.
    downEvent =  AS::Event::KeyboardEvent.new(true, AS::Event::KeyboardEvent::Keysyms[:Key_DOWN])
    #events must be made within a dequeue that has a block to be yielded to.


  end

end

